{# STORAGE : only show for concrete entries #}
{% if Entity.entityType.value == 'experiments' or Entity.entityType.value == 'items' %}
{% include 'add-container-modal.html' %}
<h3 title='{{ 'Toggle visibility'|trans }}' data-action='toggle-next' data-opened-icon='fa-caret-down' data-closed-icon='fa-caret-right' class='d-inline togglable-section-title' tabindex='0' role='button' aria-expanded='true' aria-controls='storageDivContent'><i class='fas fa-caret-down mr-2 fa-fw'></i>{{ 'Storage'|trans }} (<span id='containersCount'>{{ Entity.entityData.containers|length }}</span>)</h3>
<div class='row mt-2' id='storageDivContent' data-save-hidden='storageDivContent' data-count-for='containersCount'>
  <div class='ml-3 mt-3 col-md-12'>
      {% if Entity.entityData.containers %}
        <ul class='list-group' id='containersDiv'>
          {% for container in Entity.entityData.containers %}
            <li class='list-group-item countable'>
              <div class='d-flex flex align-items-center'>
                <div>
                  <span class='mr-2'><span class='malleableColumn hl-hover-gray p-1 rounded' data-ma-type='number' data-endpoint='{{ Entity.entityType.value }}/{{ Entity.id }}/containers' data-id='{{ container.id }}' data-target='qty_stored'>{{ container.qty_stored }}</span> <span class='mr-2'><span class='malleableQtyUnit hl-hover-gray p-1 rounded' data-endpoint='{{ Entity.entityType.value }}/{{ Entity.id }}/containers' data-id='{{ container.id }}'>{{ container.qty_unit }}</span> {{ 'in'|trans }} {{ container.full_path }}</span>
                </div>
                <div class='ml-auto'>
                  <a href='inventory.php?storage_unit={{ container.storage_id }}' class='hl-hover-gray rounded p-1 ml-auto'><i class='fas fa-magnifying-glass'></i></a>
                  <span data-action='destroy-container' data-id='{{ container.id }}' class='hl-hover-gray rounded p-1 ml-auto'><i class='fas fa-trash-alt'></i></span>
                </div>
              </div>
            </li>
          {% endfor %}
        </ul>
    {% else %}
    {{ 'No containers stored'|trans }}
    {% endif %}
    {% if not Entity.isReadOnly %}
      <div>
        <button type='button' title='{{ 'Modify storage'|trans }}' aria-label='{{ 'Modify storage'|trans }}' class='btn btn-ghost my-2' data-action='toggle-modal' data-target='storageModal'>
          <i class='fas fa-fw fa-square-plus mr-2'></i>{{ 'Add container'|trans }}
        </button>
      </div>
    {% endif %}
  </div>
</div>
<hr>
{% endif %}
